<?php
define( '_VALID_MOS', 1 );
@session_start();
error_reporting(0);
extract($_REQUEST);
//import_request_variables('gprc'); // no prefix?
define("blank", "N/A");

// Included libraries.
include("./.htinc/_mysql.php");
include("./.htinc/_general.php");
include("./.htinc/_admin_functions.php");
//include("FCKeditor/FCKeditor/fckeditor.php");
include("class.phpmailer.php");
include("resize.php");
include("array.php");
include('./ip.php');
include ('Thumbnail.class.php');


//echo '<LINK href=".css/_admin.css" type=text/css rel=stylesheet>';
//echo '<LINK href=".css/ajax-tooltip.css" type=text/css rel=stylesheet>';
//echo '<LINK href=".css/ajax-tooltip-demo.css" type=text/css rel=stylesheet>';
//echo '<script language="javascript" src="admin_function.js"></script>'; 
//echo '<script language="javascript" src="js/ajax.js"></script>'; 
//echo '<script language="javascript" src="js/ajax-tooltip.js"></script>'; 
//echo '<script language="javascript" src="js/ajax-dynamic-content.js"></script>'; 
//echo '<script language="javascript" src="location.js"></script>'; 
//echo '<link href=".css/admin_style.css" rel="stylesheet" type="text/css" />';
/*echo '<LINK href=".css/tonic.css" type=text/css rel=stylesheet>';
echo '<LINK href=".css/style.css" type=text/css rel=stylesheet>';
echo '<script language="javascript" src=".js/admin_validation.js"></script>'; */


//make object of classes 
$dbh = new GenericDatabaseClass();
$adm_functions = new adminfunctions($dbh);

//if(!$lang) $lang=1;
//else $lang=$lang;

global $SITE_TITLE, $SITE_EMAIL, $SITE_URL, $MAX, $MAXFILESIZE, $UPLOADTYPE, $FOOTER,$Decrease_Bid, $Bid_Rate, $First_purchase_bid;

$qry="select * from general_setting where id=1";
$res=$dbh->query($qry);
$row=mysql_fetch_object($res);
$SITE_LOGO_ADMIN=addslashes($row->logo_admin);
$SITE_TITLE=addslashes($row->site_title);
$SITE_URL=addslashes($row->site_url);
$SITE_EMAIL=addslashes($row->site_email);
$admin_email=addslashes($row->email);
$Meta_description=addslashes($row->meta_description);
$Meta_keyword=addslashes($row->meta_keyword);
$FOOTER=addslashes($row->footer);
$MAX=addslashes($row->rows_per_page);
$Decrease_Bid=addslashes($row->decrease_bid);
$Bid_Rate=addslashes($row->bid_rate);
$MAXFILESIZE=addslashes($row->max_file_size);
$MAXFILESIZE=$MAXFILESIZE*1024;
$UPLOADTYPE=addslashes($row->upload_file_type);
$First_purchase_bid=stripslashes($row->first_purchase_bid);
$UPLOADTYPE=explode(',',$UPLOADTYPE);

//Call functions and store value in variables
function trim_value(&$value)
{
  $value = trim($value);
}
array_walk($UPLOADTYPE,'trim_value');

//$left_menu=$adm_functions->left_menu();
$admin_header=$adm_functions->admin_header();
$adm_header=$adm_functions->adm_header();
$pop_up_header=$adm_functions->pop_up_header();

// What page are we to show?
if(!$show) 
	$show = "index"; 
$page = "admin_$show.html";


//$Resquet_Url=explode("?",$_SERVER['REQUEST_URI']);
//$Flag_list=$adm_functions->Get_flags($Resquet_Url[1]);

if($ltype)
	$_SESSION['LANG']=$ltype;
		
if(!$_SESSION['LANG'])
	$_SESSION['LANG']=1;
	
if(!$ltype)
	{
	$Resquet_Url=explode("?",$_SERVER['REQUEST_URI']);
	$Link_url=$Resquet_Url[1];
	}
else
	{
	$Resquet_Url=explode("?",$_SERVER['REQUEST_URI']);
	$Resquet_Url=explode("&ltype",$Resquet_Url[1]);
	$Link_url=$Resquet_Url[0];
	}


// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/fckeditor/' ;	// '/fckeditor/' is the default value.
//echo $cont=$_POST['FCKeditor1'];

// sementara sipelaut
//$sBasePath="FCKeditor/FCKeditor/";
//$oFCKeditor = new FCKeditor('FCKeditor1') ;
//$oFCKeditor->BasePath	= $sBasePath ;

//$oFCKeditor1 = new FCKeditor('FCKeditor2') ;
//$oFCKeditor1->BasePath	= $sBasePath ;
 
//$oFCKeditor3 = new FCKeditor('FCKeditor3') ;
//$oFCKeditor3->BasePath	= $sBasePath ;
 
// sampai sini 



// If the page is the index frameset, then just show that - no parsing!
// The index frameset is used to protect the URLs from display within the location bar of the browser,
// as well as to control the size of the display area; if this is not needed, then simply remove
// the following code.
// If there is a page-specific include file, then use it.
$my_include_file = ".htinc/admin_$show.php";

if(file_exists($my_include_file)) {
	@include("$my_include_file");
}



// Should the background be shown or not?
if(!$no_background) $background = "background='.gfx/$skin/felicia_bg.gif'";

// Only do the include here so that the template bits can include variables (specifically the
// variable to say what page we are currently viewing in the administration panels; $show).
($localhosted) ? $returned_page = $html_config["admin_header"] : $returned_page = $html_config["admin_header"];
$returned_page = GSL_ParseHTML($returned_page,$page);

($localhosted) ? $returned_page .= $html_config["admin_footer"] : $returned_page .= $html_config["admin_footer"];

eval("\$returned_page = \"$returned_page\";");
echo $returned_page;

?>

<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
function changeScrollbarColor(C){
  if (document.all){
    document.body.style.scrollbarBaseColor = C
  }   
}

</script>
<script>
function RedirectPage(PageName)
{	window.location.href = PageName;
}
</script>